// import '../extension/string_check.dart';
// import 'comment_model.dart';

class ReplyListRes {
  List<ReplyModel>? list;
  bool hasNext = false;

  static ReplyListRes fromJson(Map<String, dynamic>? map) {
    map ??= {};
    ReplyListRes replyListResBean = ReplyListRes();
    replyListResBean.list = (map['list'] as List?)?.map((o) => ReplyModel.fromJson(o)).toList();
    replyListResBean.hasNext = map['hasNext'];
    return replyListResBean;
  }

  Map toJson() => {
        "list": list,
        "hasNext": hasNext,
      };
}

class ReplyModel {
  String? id;
  String? objID;
  String? cid;
  int? userID;
  String? userName;
  String? userPortrait;
  int? toUserID;
  String? toUserName;
  String? content;

  int? likeCount;
  bool? isLike;
  bool? isAuthor;
  bool? isFollow;
  bool? isDelete;
  String? gender;
  int? status;
  String? city;
  String? createdAt;
  int? age;
  int? level;

  bool? imgLoadSuccess = false;
  int? code; // 错误code
  String? tip; // 错误提示
  String? image;
  int? commentCount;
  static ReplyModel fromJson(Map<String, dynamic>? map) {
    map ??= {};

    ReplyModel info = ReplyModel();
    info.image = map['image'];
    info.id = map['id'];
    info.code = map["code"];
    info.tip = map["tip"];
    info.objID = map['objID'];
    info.cid = map['cid'];
    info.userID = map['userID'];
    info.userName = map['userName'];
    info.userPortrait = map['userPortrait'];
    info.toUserID = map['toUserID'];
    info.toUserName = map['toUserName'];
    info.content = map['content'];
    info.likeCount = map['likeCount'];
    info.isLike = map['isLike'];
    info.isAuthor = map['isAuthor'];
    info.isFollow = map['isFollow'];
    info.isDelete = map['isDelete'];
    info.gender = map['gender'].toString();
    info.status = map['status'];
    info.city = map['city'];
    info.createdAt = map['createdAt'];
    info.age = map['age'];
    info.level = map['level'];
    info.commentCount = map['commentCount'];
    return info;
  }

  Map toJson() => {
        "id": id,
        "image": image,
        "objID": objID,
        "cid": cid,
        "userID": userID,
        "userName": userName,
        "userPortrait": userPortrait,
        "toUserID": toUserID,
        "toUserName": toUserName,
        "content": content,
        "likeCount": likeCount,
        "isLike": isLike,
        "isAuthor": isAuthor,
        "isFollow": isFollow,
        "isDelete": isDelete,
        "gender": gender,
        "status": status,
        "city": city,
        "createdAt": createdAt,
        "level": level,
        "age": age,
        "commentCount": commentCount,
      };
}
